﻿package com.tudou.home.newskin.buttons
{
    import com.tudou.consts.*;
    import com.tudou.skin.*;
    import com.tudou.skin.common.button.*;
    import com.tudou.utils.*;
    import flash.display.*;

    public class RateRadio extends RadioButton
    {
        public var rateSetting:InteractiveObject;

        public function RateRadio(param1:int, param2:Boolean)
        {
            var _loc_3:SelectButton = null;
            var _loc_11:int = 0;
            var _loc_4:Array = [];
            [][RateType.P256] = new P256SelectBTN();
            _loc_4[RateType.P360] = new P360SelectBTN();
            _loc_4[RateType.P480] = new P480SelectBTN();
            _loc_4[RateType.P720] = new P720SelectBTN();
            _loc_4[RateType.ORIGINAL] = new OriginalSelectBTN();
            var _loc_5:Array = [];
            [][RateType.P256] = new P256UnselectBTN();
            _loc_5[RateType.P360] = new P360UnselectBTN();
            _loc_5[RateType.P480] = new P480UnselectBTN();
            _loc_5[RateType.P720] = new P720UnselectBTN();
            _loc_5[RateType.ORIGINAL] = new OriginalUnselectBTN();
            var _loc_6:Number = 18;
            var _loc_7:Number = 0;
            var _loc_8:int = 4;
            rateSetting = new RateSettingBTN();
            addChild(rateSetting);
            var _loc_9:* = -rateSetting.height - 2;
            rateSetting.x = _loc_7;
            rateSetting.y = _loc_9;
            _loc_9 = _loc_9 - _loc_6;
            _loc_8 = _loc_8 + rateSetting.height;
            var _loc_10:* = RateUtil.getAvailable(param1, param2);
            var _loc_12:int = 0;
            while (_loc_12 < _loc_10.length)
            {
                
                _loc_11 = _loc_10[_loc_12];
                _loc_3 = new SelectButton(_loc_4[_loc_11], _loc_5[_loc_11], null);
                addSelectButton(_loc_3, _loc_7, _loc_9, _loc_11.toString());
                _loc_8 = _loc_8 + _loc_6;
                _loc_9 = _loc_9 - _loc_6;
                _loc_12++;
            }
            var _loc_13:* = new RateBackgroundMC();
            new RateBackgroundMC().width = 101;
            _loc_13.height = _loc_8 + 4;
            setBackground(_loc_13, 0, -_loc_13.height);
            return;
        }// end function

    }
}
